let basUrl = 'https://www.900yeah.com/';
const app = getApp()

exports.register = (data, callback) => { // 二维码判断
  console.log(data, '登录判断')
  wx.request({
    url: basUrl + 'api/Login/judgment',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function(res) {
      callback(res)
    },
    fail: function(err) {
      callback(err)
    }
  })
}


exports.addshop = (data, callback) => { // 添加店铺
  console.log(data, '添加店铺')
  wx.request({
    url: basUrl + 'api/Distribution/index',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function(res) {
      callback(res)
    },
    fail: function(err) {
      callback(err)
    }
  })
}
exports.shoplist = (data, callback) => { // 店铺列表
  console.log(data, '店铺列表接口')
  wx.request({
    url: basUrl + 'api/Distribution/newlist',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function(res) {
      callback(res)
    },
    fail: function(err) {
      callback(err)
    }
  })
}
exports.shopamend = (data, callback) => { // 店铺修改
  console.log(data, '店铺修改接口')
  wx.request({
    url: basUrl + 'api/Distribution/update',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function(res) {
      callback(res)
    },
    fail: function(err) {
      callback(err)
    }
  })
}
exports.amendmobile = (data, callback) => { // 修改手机号
  console.log(data, '修改手机号接口')
  wx.request({
    url: basUrl + 'api/Distribution/mobile',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function(res) {
      callback(res)
    },
    fail: function(err) {
      callback(err)
    }
  })
}
exports.amendshow = (data, callback) => { // 门店修改展示
  console.log(data, '门店修改展示接口')
  wx.request({
    url: basUrl + 'api/Distribution/distrilist',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function(res) {
      callback(res)
    },
    fail: function(err) {
      callback(err)
    }
  })
}
exports.user = (data, callback) => { // 用户明细
  console.log(data, '用户明细接口')
  wx.request({
    url: basUrl + 'api/user/shopuser',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.user_order = (data, callback) => { // 订单明细
  console.log(data, '订单明细接口')
  wx.request({
    url: basUrl + 'api/user/user_order',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
// --------------------------------------------------------------
exports.verify = (data, callback) => { // 获取验证码
  console.log(data, '获取验证码')
  wx.request({
    url: basUrl + 'api/dblong/logincode',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.page = (data, callback) => { // 首页上部分
  console.log(data, '首页上部分')
  wx.request({
    url: basUrl + 'api/dblong/index',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.pagebottom = (data, callback) => { // 首页下部分
  console.log(data, '首页下部分')
  wx.request({
    url: basUrl + 'api/dblong/indexlower',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.userdetails = (data, callback) => { // 个人信息
  console.log(data, '个人信息')
  wx.request({
    url: basUrl + 'api/dblong/userdetails',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.updateuser = (data, callback) => { // 修改个人信息
  console.log(data, '个人信息')
  wx.request({
    url: basUrl + 'api/dblong/updateuser',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.ditchqrcode = (data, callback) => { // 个人二维码
  console.log(data, '个人二维码')
  wx.request({
    url: basUrl + 'api/dblong/ditchqrcode',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}

exports.userlevel = (data, callback) => { // 渠道管理
  console.log(data, '渠道管理')
  wx.request({
    url: basUrl + 'api/dblong/userlevel',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.users_details = (data, callback) => { // 用户明细
  console.log(data, '用户明细')
  wx.request({
    url: basUrl + 'api/dblong/users_details',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.userorder = (data, callback) => { // 订单明细
  console.log(data, '订单明细')
  wx.request({
    url: basUrl + 'api/dblong/userorder',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.leveladd = (data, callback) => { // 添加店铺
  console.log(data, '添加店铺')
  wx.request({
    url: basUrl + 'api/dblong/leveladd',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.ditch = (data, callback) => { // 展示店铺信息
  console.log(data, '展示店铺信息')
  wx.request({
    url: basUrl + 'api/dblong/ditch',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
},
  exports.updatelist = (data, callback) => { // 修改店铺
    console.log(data, '修改店铺')
    wx.request({
      url: basUrl + 'api/dblong/updatelist',
      header: {
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      data: data,
      method: 'POST',
      success: function (res) {
        callback(res)
      },
      fail: function (err) {
        callback(err)
      }
    })
  },

exports.updateditch = (data, callback) => { // 修改电话
  console.log(data, '修改电话')
  wx.request({
    url: basUrl + 'api/dblong/updateditch',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.updatecode = (data, callback) => { // 修改渠道获取验证码
  console.log(data, '修改渠道获取验证码')
  wx.request({
    url: basUrl + 'api/dblong/updatecode',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.property = (data, callback) => { // 我的资产明细
  console.log(data, '我的资产明细')
  wx.request({
    url: basUrl + 'api/dblong/property',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.bankcard = (data, callback) => { // 绑定银行卡
  console.log(data, '绑定银行卡')
  wx.request({
    url: basUrl + 'api/dblong/bankcard',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.rebate = (data, callback) => { // 返佣管理明细
  console.log(data, '返佣管理明细')
  wx.request({
    url: basUrl + 'api/dblong/rebate',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.transaction = (data, callback) => { // 交易明细
  console.log(data, '交易明细')
  wx.request({
    url: basUrl + 'api/dblong/transaction',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.deposit = (data, callback) => { // 提现
  console.log(data, '提现')
  wx.request({
    url: basUrl + 'api/dblong/deposit',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.applyfor = (data, callback) => { // 返佣申请
  console.log(data, '返佣申请')
  wx.request({
    url: basUrl + 'api/dblong/applyfor',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.applyConfirmation = (data, callback) => { // 确认返佣
  console.log(data, '确认返佣')
  wx.request({
    url: basUrl + 'api/dblong/confirmation',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.embody = (data, callback) => { // 提现明细
  console.log(data, '提现明细')
  wx.request({
    url: basUrl + 'api/dblong/embody',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.rebatelist = (data, callback) => { // 返佣明细
  console.log(data, '返佣明细')
  wx.request({
    url: basUrl + 'api/dblong/rebatelist',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}


/*
  api.***********(data, res => {
      console.log(res)
      this.setData({
        indexData: res.data.result
      })
    })

  1.上传头像   *****
  2.所有input判断。
  3.提现流程时间。24：00
  4.所有第三方。
  5.银行卡加密。
  6.手机号加密。
  
  1.资产管理下拉刷新。
  2.0单隐藏。
  3.H5页面。
*/

